package com.biboheart.demo.report.support.jpa;

import lombok.Getter;

@Getter
public enum SQLFunEnum {
    FUN_AND(1, "bit_and"), //与
    FUN_OR(2, "bit_or"), //或
    FUN_XOR(3, "bit_xor"), // 异或
    FUN_EQUAL(4, "bit_equal"), // 等于
    FUN_ASCII(5, "ASCII"), // ASCII码
    ;

    private final Integer code;
    private final String bitFun;

    SQLFunEnum(Integer code, String bitFun) {
        this.code = code;
        this.bitFun = bitFun;
    }

    public static SQLFunEnum get(Integer code) {
        for (SQLFunEnum value : SQLFunEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
